<template>
	<view class="noticeLayout" v-if="wallNewDetail">
		<view class="title">
			<view class="tag" v-if="wallNewDetail.select">
				<uni-tag text="置顶" type="error" inverted></uni-tag>
			</view>
			<view class="font">
				{{wallNewDetail.title}}
			</view>
		</view>
		
		<view class="info">
			<view class="item">
				{{wallNewDetail.author}}
			</view>
			<view class="item">
				<uni-dateformat :date="Date.now()" format="yyyy-MM-dd hh:mm:ss"></uni-dateformat>
			</view>
		</view>
		
		<view class="content">
			<mp-html :content="wallNewDetail.content" />
		</view>
		
		<view class="count">
			阅读量 {{wallNewDetail.view_count}}
		</view>
	</view>
</template>

<script setup>
import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import {apiWallNewsDetail} from "@/apis/apis.js"

const wallNewDetail = ref({})
let detail

onLoad((e)=>{
	detail = e.id
	getWallNewsDetail()
})
	
const getWallNewsDetail = async ()=>{
	let res = await apiWallNewsDetail({id:detail});
	wallNewDetail.value = res.data
	console.log(wallNewDetail.value);
}



</script>

<style lang="scss" scoped>
.noticeLayout{
	padding: 30rpx;
	.title{
		display: flex;
		.tag{
			white-space: nowrap;
			margin-right: 20rpx;
		}
		.font{
			font-size: 36rpx;
		}
	}
	.info{
		padding: 30rpx 0;
		display: flex;
		color: $uni-color-text3;
		font-size: 24rpx;
		.item{
			padding-right: 20rpx;
		}
	}
	.content{
		padding-bottom: 30rpx;
	}
	.count{
		color: $uni-color-text3;
		font-size: 24rpx;
	}
}
</style>
